<!DOCTYPE html>
<html>
<head>
  <title>LA2ETLAK!</title>

	<%= stylesheet_link_tag    "application", :media => "all" %>
  	<%= javascript_include_tag "application" %>
    <%= javascript_include_tag "exporting" %>
	<%= javascript_include_tag "jquery" %>
	<%= javascript_include_tag "prototype" %>
	<%= javascript_include_tag "effects" %>
	<%= javascript_include_tag "controls" %>
    <%= javascript_include_tag "highcharts" %>
	<%= javascript_include_tag "bootstrap-modal" %>
	<%= javascript_include_tag "bootstrap-transition" %>
	<%= javascript_include_tag "bootstrap-collapse" %>
	<%= javascript_include_tag "bootstrap-dropdown" %>
  	<%= javascript_include_tag "graph" %>
  	<%= javascript_include_tag "bootstrap-tab" %>
  	<%= csrf_meta_tags %>
	


<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
		
		</head>

<header class="navbar navbar-fixed-top">

      <div class="navbar-inner">
        <div class="container">
          <%= link_to "LA2ETLAK", {controller: 'admins' ,action: 'index'}, id: "logo" %>

        <form class="offset2 span4 navbar-search pull-left" action="/admins/search">
         	<%= text_field_with_auto_complete :autocomplete,:query,{ 
			    :placeholder => 'search',
				:controller =>'autocomplete',
				:autofocus => false ,
			    :class => "search-query"},{:skip_style =>true}%>
			
        </form>
          <nav>
            <ul class="nav pull-right">
			  <li class="divider-vertical"></li>
				<ul class="nav nav-pills">
				   <li class="dropdown">
			                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" onclick="dropdown();"><% if current_admin == nil %> [Admin_name] <% else %> <%= current_admin.email %><% end%> <b class="caret"></b></a>
			                    <ul class="dropdown-menu">
			                      <li><a href="/admin_settings"><i class="icon-cog"> </i> Settings</a></li>
			                      <li class="divider"></li>
			                      <li><a href="/admin/logout">Logout</a></li>
			                    </ul>
			       </li>
				</ul>
			</ul>
          </nav>
        </div>
      </div>
    </header>
	<SCRIPT language="javascript">
		function dropdown(){
		var $j = jQuery.noConflict();
		$j('.dropdown-toggle').dropdown();
		};
	</SCRIPT>
	<% keys = flash.keys %>
	<% keys.each do |key| %>
	  <% fl = flash[key] %>
	  <% if fl == "" then next end %>
	  <% color = fl["$red"] || fl["$green"] || fl["$yellow"] || fl["$blue"]%>
	  <% if color %>
	    <% fl[color] = "" %>
	  <% else %>
	    <% color = "$yellow" %>
	  <% end %>
	  <div class="flash-<%= color[1,10] %> well" id="notification"> <!-- assigning css color class triming tailing $ -->
	  <%= raw fl %>
	  <% flash[key] = "" %>
	  </div>
	<% end %>
<body>
      <%= yield %>

</body>
</html>
